# -*- coding: utf-8 -*-
# @Time : 2023/12/17 20:20
# @Author : Lpb
# @File : demo1.py

# 代码需要复用
def all_login(platform):
    def inner(func):
        def qq_login(*args,**kwargs):
            print('qq login')
            func(*args,**kwargs)
            print('qq logout')

        def weibo_login(*args, **kwargs):
            print('weibo login')
            func(*args, **kwargs)
            print('weibo logout')

        def wx_login(*args, **kwargs):
            print('wx login')
            func(*args, **kwargs)
            print('wx logout')

        if platform =='qq_login':
            return qq_login
        elif platform == 'weibo_login':
            return weibo_login
        else:
            return wx_login
    return inner

@all_login('wx_login')
def dnf():
    print('dnf play ing')

@all_login('qq_login')
def lol(hero):
    print(f'choose hero :{hero}')
    print('lol play ing')


dnf()
lol('海冰')